package cn.wolfcode.trip.base.mapper;

import cn.wolfcode.trip.base.domain.MyMessageRelation;
import cn.wolfcode.trip.base.domain.SystemInform;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface MyMessageRelationMapper {



    int deleteByPrimaryKey(Long id);



    //新增赞游记的记录
    int insertLikeTravel(MyMessageRelation record);
    //新增赞评论的记录
    int insertLikeComment(MyMessageRelation record);
    //新增评论游记的记录
    int insertCommentTravel(MyMessageRelation record);
    //新增评论评论的记录
    int insertCommentComment(MyMessageRelation record);
    //新增私信用户的记录
    int insertSmsUser(MyMessageRelation record);


    MyMessageRelation selectByPrimaryKey(Long id);


    //查询赞游记的记录
    List<MyMessageRelation> selectTypeByLikeTravel(@Param("type") Integer type, @Param("userId") Long userId);
    //查询赞评论的记录
    List<MyMessageRelation> selectTypeByLikeComment(@Param("type") Integer type, @Param("userId") Long userId);
    //查询评论游记的记录
    List<MyMessageRelation> selectCommentTypeByTravel(@Param("type") Integer type, @Param("userId") Long userId);
    //查询评论评论的记录
    List<MyMessageRelation> selectCommentTypeByComment(@Param("type") Integer type, @Param("userId") Long userId);
    //查询私信用户的记录
    List<MyMessageRelation> selectSmsTypeByUser(@Param("type") Integer type, @Param("userId") Long userId);

    //取消点赞游记的时候，还要同步的删除我的消息记录
    void deleteLikeMessageByUserIdAndTravelId(@Param("userId") Long userId, @Param("travelId") Long travelId, @Param("messagetype") Integer messagetype);

    /*
    查询被评论的游记总数和被回复的评论总数
     */
    Integer getCommentTravelTotalByUserId(@Param("userId") Long userId);
    Integer getCommentCommentTotalByUserId(@Param("userId") Long userId);
    Integer selectSmsTotalByUserId(@Param("userId") Long userId);
    //查询指定用户的系统通知消息
    List<SystemInform> selectSystemMessageByUserId(@Param("userId") Long userId);

    Integer selectSystemMessageTotalByUserId(@Param("userId") Long userId);
}